import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt

# from scipy.spatial import Voronoi, voronoi_plot_2d
# import numpy as np
#
# points = np.array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2],
#                    [2, 0], [2, 1], [2, 2], [2.5, 2]])
# vor = Voronoi(points)
#
# print(vor.points)
# import matplotlib.pyplot as plt
# fig = voronoi_plot_2d(vor)
# plt.show()


import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import Voronoi, voronoi_plot_2d
points = np.random.rand(12,2) #random points
vor = Voronoi(points)
fig = voronoi_plot_2d(vor)
plt.savefig("voronoi_plot_2d_1.png",dpi=130)
plt.show()